import { Column, CreateDateColumn, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
import { BannerData } from "./banner_data.entity";

@Entity()
export class BannerType {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    comment: "名称",
    unique: true,
  })
  name: string;

  @Column({
    comment: "标识key",
    unique: true,
  })
  code: string;

  @Column({
    comment: "描述",
    nullable: true,
  })
  remake: string;

  @CreateDateColumn()
  createTime: Date;

  @OneToMany(()=> BannerData, (data)=> data.bannerType)
  bannerData: BannerData[];
}